package yiqiyihui.com.orderquery.util;

import android.content.Context;
import android.graphics.Canvas;
import android.util.AttributeSet;
import android.view.View;
import android.widget.AbsListView;
import android.widget.ListView;

/**
 * Created by Administrator on 2017/7/18.
 */

public class WangXuListView extends ListView implements AbsListView.OnScrollListener {
    private View mScrollBarPennel;

    public WangXuListView(Context context) {
        this(context,null);
    }

    public WangXuListView(Context context, AttributeSet attrs) {
        this(context, attrs,0);
    }

    public WangXuListView(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }

    @Override
    protected void dispatchDraw(Canvas canvas) {
        //绘制自己的；
        super.dispatchDraw(canvas);
        //绘制自己的---在原来所有的容器的子控件上覆盖我的view；
        if (mScrollBarPennel!=null){
            drawChild(canvas,mScrollBarPennel,getDrawingTime());
        }

    }

    @Override
    public void onScrollStateChanged(AbsListView absListView, int i) {

    }

    @Override
    public void onScroll(AbsListView absListView, int i, int i1, int i2) {

    }

    @Override
    protected boolean awakenScrollBars() {
        return super.awakenScrollBars();
    }
}
